#!/bin/bash
sum=0;

for ((i=1; i&lt;=10; i++));
do
let "sum=$sum+$i";
done

echo $sum;

for j in $(seq 1 10)
do
let "sum=$j+$sum";
done

echo $sum;

i=1;
while(($i&lt;=10))
do
let "sum=$sum+$i";
let "i=$i+1";
done

echo $sum;
min=1;
max=10;
# 注意"[ ]"的空格
while [[ $min -le $maxi ]]
do
let "sum=$sum+$i";
let "i=$i+1";
done

echo $sum;